home *** CD-ROM | disk | FTP | other *** search
- Path: prairienet.org!wemccaug
- From: wemccaug@prairienet.org (Wendy E. McCaughrin)
- Newsgroups: comp.lang.c++
- Subject: Re: Fastest Sorting Algorithm?
- Date: 14 Apr 1996 00:09:17 GMT
- Organization: University of Illinois at Urbana
- Message-ID: <4kpfnd$3ed@vixen.cso.uiuc.edu>
- References: <4k680p$6fs@longwood.cs.ucf.edu> <Dou55w.7MB@novice.uwaterloo.ca> <DpAxtI.3w9@undergrad.math.uwaterloo.ca> <4k4unk$15q
- Reply-To: wemccaug@prairienet.org (Wendy E. McCaughrin)
- NNTP-Posting-Host: firefly.prairienet.org
-
-
- >
- >Is it really 2logn? My understanding was that a sort couldn't be
- >less than nlogn... More info, please.
- >
- You are correct: Quicksort performance is O(n*log(n)), usually
- written: O(nlog n). The analysis to obtain its performance com-
- monly show O(n*lg(n)), with "lg' meaning log, base 2. But if
- b is any other acceptable base and "log" means log, base b:
- lg(n) = log(n)/log(2) and n*lg(n) = (1/log(2))*n*log(n). When
- the only difference is a constant of proportionality (1/log(2)),
- then O(n*lg(n)) is O(n*log(n)).
-
-